<template>
  <div class="house-detail">
    <split-title>基础信息</split-title>
    <descriptions :columns="columns.slice(0, 5)" :data-source="details" :col-span="24" />
    <template v-if="details.handle_status == 1">
      <split-title>处理信息</split-title>
      <descriptions :columns="columns.slice(-3)" :data-source="details" :col-span="24" />
    </template>
  </div>
</template>

<script>
import SplitTitle from '@gis/lib/components/splitter/split-title.vue';
import { getEnumText } from '@gis/lib/enums/index.js';
export default {
  name: 'house-detail',
  components: { SplitTitle },
  props: {
    details: {
      type: Object,
      default: () => {},
    },
  },
  data() {
    return {
      columns: [
        { label: '房间全名称', key: 'field2' },
        { label: '预警时间', key: 'warn_time' },
        { label: '预警类型', key: 'warn_type_name' },
        { label: '预警内容', key: 'warn_content' },
        { label: '是否处理', key: 'handle_status', format: (v) => getEnumText('alarmHandleStatus', v) },
        { label: '处理时间', key: 'handle_time' },
        { label: '处理人', key: 'handle_people_name' },
        { label: '处理结果', key: 'handle_result' },
      ],
    };
  },
};
</script>

<style lang="less">
.house-detail {
  width: 100%;
  height: 100%;
  overflow: hidden auto;
  padding: 20px;
}
</style>
